function ajaxForm () {
  var bar = $('.bar');
  var percent = $('.percent');
  // var status = $('#status');

  $('#form').ajaxForm({
    beforeSend: function () {
        // status.empty();
        var percentVal = '0%';
        bar.width(percentVal)
        percent.html(percentVal);
    },
    uploadProgress: function (event, position, total, percentComplete) {
        var percentVal = percentComplete + '%';
        bar.width(percentVal)
        percent.html(percentVal);
    },
    success: function (response, statusText, xhr, wrap) {
        // console.log(response);
       if (response.status === 1) {
          crop_img(response.resp);
        } else {
          var parent = $('#uniform-'+response.element).parent();
          parent.children("#progress-bar, .percent").remove();
          $('#uniform-'+response.element).css({"display":"block"});

          noty({"text":response.resp, "layout":"topRight", "type":"error"});
        }
    },
    dataType: 'json'
  });
}
